package cn.com.suiyi.shixingshengxian.active;

import android.util.Log;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import cn.com.suiyi.shixingshengxian.base.IBasePresenter;
import cn.com.suiyi.shixingshengxian.bean.ActiveBean;

/**
 * Created by Administrator on 2016/7/18.
 */
public class ActivePresenter extends IBasePresenter<ActiveContract.ActiveView>{
    private ActiveContract.ActiveModel model;

    public ActivePresenter() {
        model=new ActiveModel();
        model.init();
        EventBus.getDefault().register(this);
    }
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void sub(ActiveBean activeBean) {
        if (activeBean == null) {
            getView().onFail("失败");
        } else {
            getView().onSuccess(activeBean);
        }
    }
}
